<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../css/mui.min.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
			.mui-fadein {
				/*-webkit-animation: fadein 0.1s;
				animation: fadein 0.1s;*/
				
				opacity: 1;
			}
			.mui-fadeout {
				opacity: 0;
			}
			@keyframes fadein {
				from {
					opacity: 0;
				}
				to {
					opacity: 1;
				}
			}
			@-webkit-keyframes fadein {
				from {
					opacity: 0;
				}
				to {
					opacity: 1;
				}
			}
			@keyframes fadeout {
				from {
					opacity: 1;
				}
				to {
					opacity: 0;
				}
			}
			@-webkit-keyframes fadeout {
				from {
					opacity: 1;
				}
				to {
					opacity: 0;
				}
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a id="back" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">下拉刷新和上拉加载更多</h1>
		</header>
		<div class="mui-content"></div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/app.js"></script>
	<script type="text/javascript">
		//启用双击监听
		mui.init({
			gestureConfig:{
				doubletap:true
			}
		});
		var titleElem = document.getElementById("title");
		window.addEventListener("updateHeader", function(e) {
			var title = '下拉刷新和上拉加载更多';
			titleElem.innerHTML = title;
			titleElem.className = "mui-title mui-fadein";
		});
		var contentWebview = null;
		document.querySelector('header').addEventListener('doubletap',function () {
			if(contentWebview==null){
				contentWebview = plus.webview.currentWebview().children()[0];
			}
			if(mui.os.ios){
				contentWebview.evalJS("mui('#pullrefresh').pullRefresh().scrollTo(0,0,100)");
			}else{
				contentWebview.evalJS('mui.scrollTo(0, 100)');
			}
		});
	</script>

</html>